package com.bgrconsulting.stockorderentry.service.converter;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import com.bgrconsulting.stockorderentry.service.model.AccountPosition;
import com.bgrconsulting.stockorderentry.service.model.Product;

@XmlRootElement(name = "accountPosition")
public class AccountPositionConverter {
		
	private AccountPosition enity = null;
	
	
	public AccountPositionConverter(AccountPosition accountPosition) {
		enity = accountPosition;
	}
	
	public AccountPositionConverter() {
		enity = new AccountPosition();
	}
	
	@XmlElement(name = "costBasis")
	public Double getCostBasis() {
		return enity.getCostBasis();
	}
	
	 @XmlElement(name = "longOrShort")
	public String getLongOrShort() {
		return enity.getLongOrShort();
	}
	
	 @XmlElement(name = "marginable")
	public boolean getMarginable() {
		return enity.getMarginable();
	}
	
	 @XmlElement(name = "productId")
	public ProductConverter getProduct() {
		ProductConverter pc = new ProductConverter(enity.getProduct());
		return pc;
	}
	
	
	 @XmlElement(name = "quanity")
	public Double getQuanity() {
		return enity.getQuanity();
	}
	
	
	 @XmlElement(name = "marketValue")
	public Double getMarketValue() {
		return enity.getMarketValue();
	}

}
